/*
 This file is part of TEdit
 Copyright (C) 2009 Team16
 Writed by Bonapart(aka Justuser)
All modification should link to me or my page as program creator
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License
for more details. You should have received a copy of the GNU General
Public License along with this program. If not, see <http://www.gnu.org/license>
 */
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui>


#include "highlighter.h"
#include "finddialog.h"
#include "options.h"
#include "templates.h"

QT_BEGIN_NAMESPACE
class QTextEdit;
QT_END_NAMESPACE


class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);

private slots:
#ifndef Q_OS_SYMBIAN
    void expPDF();
    void expHTML();
#endif
    void newFile();
    void openFile(const QString &path = QString());
    void saveFile();
    void saveFileAs();
    void sizeF();
    void enc_at();
    void men();
    void high();
    void fndr();
    void searchNext();
    void opt();
    void getSet();

    void temp();

    void lngUp();
    void lngChange();
    void sipPush();
    void toE();
    void toSt();
    void changeEvent ( QEvent *) ;

    void sipShow();
    void keyPressEvent ( QKeyEvent *);
    bool eventFilter(QObject *,QEvent *);
    void sipLang();
    void enter();
    void backspace();

    void copy();
    void paste();
    void cut();

private:
    QStringList curent;
    bool upped;
    QMenu *fileMenu;
    QMenu *fil;
    QMenu *enc;
    QMenu *hg;
    QMenu *red;
    QString selEnc;

    void setupEditor();
    void setupFileMenu();

    void replaceAll();

    QString fName;

    QTextEdit *editor;
    Highlighter *highlighter;

    QWidget *centralwidget;
    QGridLayout *gridLayout;
    QLabel *label;
    QPushButton *pushButton;
    findDialog *dlg;
    options *odlg;
    templates *tdlg;


   QPushButton *sipButtons[40];
   QGroupBox *sip;
   int sipState;
   QString curcod;
};

#endif
